package lumis.portal.monitor;

import java.util.Collection;

import lumis.portal.stability.StableMinor;

/**
 * An event that may be monitored. Its definition specifies how its data
 * is collected and aggregated.
 * 
 * @see lumis.portal.monitor
 * 
 * @stereotype entity
 * @navassoc * - * IAggregationType
 * 
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 * @since 4.1.0
 */
@StableMinor(version = "6.0", sinceVersion = "4.1")
public interface IEvent
{
	/**
	 * Returns the identifier for this event.
	 * @return the identifier for this event.
	 * @since 4.1.0
	 */
	public String getId();

	/**
	 * Returns the category this event belongs to.
	 * @return the category this event belongs to.
	 * @since 4.1.0
	 */
	public ICategory getCategory();

	/**
	 * Returns the aggregation types for this event.
	 * @return the aggregation types for this event.
	 * @since 4.1.0
	 */
	public Collection<? extends IAggregationType> getAggregationTypes();

	/**
	 * Returns the description for this event. The description is localizable
	 * using {@link #getStringResourcePath()}.
	 * @return the description for this event.
	 * @since 4.1.0
	 */
	public String getDescription();

	/**
	 * Sets the description for this event.
	 * @param description the description to set.
	 * @see #getDescription()
	 * @since 4.1.0
	 */
	public void setDescription(String description);

	/**
	 * Returns the aggregation duration used for this event's data.
	 * @return the duration in milliseconds.
	 * @since 4.1.0
	 */
	public long getDuration();

	/**
	 * Sets the duration for the aggregation of this event's data.
	 * @param duration the duration in milliseconds.
	 * @see #getDuration()
	 * @since 4.1.0
	 */
	public void setDuration(long duration);

	/**
	 * Returns if the monitoring for this event is enabled.
	 * @return true if enabled or false if disabled.
	 * @since 4.1.0
	 */
	public boolean isEnabled();

	/**
	 * Enables or disables the monitoring of this event.
	 * @param enabled true to enable or false to disable.
	 * @since 4.1.0
	 */
	public void setEnabled(boolean enabled);

	/**
	 * Returns the key for this event. This key is a friendly unique identifier
	 * for this event.
	 * @return this event's key.
	 * @since 4.1.0
	 */
	public String getEventKey();

	/**
	 * Sets the key for this event.
	 * @param key the key.
	 * @see #getEventKey()
	 * @since 4.1.0
	 */
	public void setEventKey(String key);

	/**
	 * Returns the name for this event. The name is localizable
	 * using {@link #getStringResourcePath()}.
	 * @return the name for this event.
	 * @since 4.1.0
	 */
	public String getName();

	/**
	 * Sets the name for this event.
	 * @param name the name
	 * @see #getName()
	 * @since 4.1.0
	 */
	public void setName(String name);

	/**
	 * The string resource path for localizing this event's strings.
	 * @return the string resource path. 
	 * @since 4.1.0
	 */
	public String getStringResourcePath();

	/**
	 * Sets the string resource path for this event.
	 * @param stringResourcePath the string resource path.
	 * @see #getStringResourcePath()
	 * @since 4.1.0
	 */
	public void setStringResourcePath(String stringResourcePath);
}